Skip to main content
Version: 5.3.0.0

Orchestra Java Functions

Java Functions

To work with java internal functions in adapters, parameters, process variables or mappings you can choose to directly invoke them.

By default, java functions can directly be accessed via the java language api as you would use them on objects in your own code:

Java Function Invocation Java Function Invocation

Orchestra itself also hosts internal java functions to interact with the internal tooling of Orchestra. These are described in the following sections.

Orchestra Messages

The following are methods provided by Orchestra messages (class emds.epi.decl.server.message.Message).

You may invoke them to retrieve meta information about a message.

SignatureDescriptionParameters
String getMessageID()Return a unique identifier of the message.@return unique message identifier
QName getMessageType()Return the message type of the given message.@return QName representing the message type
MessageProperties getProperties()Return the map of message properties.@return message properties map
<T extends ContentRepresentation> T getContent( Class<T> representation )Return a specific representation of the message content.@param representation – class of the requested content representation
@return content in the requested representation type
QualityOfService getQualityOfService()Return the quality of service used to store the message.@return quality of service
boolean isStructured()Return true if the message contains structured content.@return true if message content is structured
boolean isMassData()Return true if the message is treated as mass data.@return true if message is mass data
boolean isBinary()Return true if message data is stored in a plain binary format.@return true if message content is binary

Note: isBinary and isStructured are not mutually exclusive
String getFingerPrint()Compute the default fingerprint of the message (MD5).@return fingerprint value as String
String getFingerPrint( String algorithm, boolean asHex )Compute a fingerprint of the message using the given hash algorithm and output format.@param algorithm – hash algorithm (MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512)
@param asHex – true for hexadecimal, false for Base64
@return fingerprint value as String
Message exportMessageTo( MessageFactory factory, boolean createNewIdentifier )Export the message to the given message factory.@param factory – target message factory
@param createNewIdentifier – whether to generate a new message identifier
@return exported message

Process Models

These methods are available if you assign expression values to a parameter in an invocation of a adapter or a mapping or if you assign expression values to process variables on the result of a adapter or mapping invocation.

Common Static Methods

SignatureDescriptionParameters
StructuredNode getContentNode( Message message )Parse the content of the message as XML and return its root as StructuredNode.@param message – message of which the root node should be evaluated
@return the root node of the given message
Object xpath( String expression, String targetType, ExpressionContext context )Evaluate an XPath expression against a structured Message using the implicit context.@param expression – XPath expression text
@param targetType – expected result type (e.g. SimpleTypes.STRING, ExtendedTypes.NODE_SET)
@param context – context providing namespaces and variables
Object xpath( Object baseObject, String expression, String targetType, ExpressionContext context )Evaluate an XPath expression against a structured Message provided as baseObject.@param baseObject – MUST be a Message, otherwise an Exception is thrown
@param expression – XPath expression text
@param targetType – expected result type
@param context – evaluation context
String getGlobalVariable( String name )Return the value of the global variable as String.@param name – name of the global variable
@return String value of the variable
Object getGlobalVariableValue( String name )Return the value of the global variable as Object.@param name – name of the global variable
@return object value of the global variable
@throws EpiBaseException
String resolveNameMapping( String mappingName, String inputValue )Resolve a named mapping and translate the input value using the first matching rule.@param mappingName – name of the mapping
@param inputValue – value to translate
@return translated value
String getScenarioIdentifier()Return the identifier of the current scenario.@return scenario ID as String
String getOwnerName()Return the name of the process model.@return process model name
String getScenarioName()Return the name of the scenario.@return scenario name
String generateIdentifier( String prefix )Generate an identifier that is unique in the context of the current Orchestra node.@param prefix – prefix of the identifier
@return unique identifier with the given prefix
String getFormattedTimestamp( String pattern )Return the current timestamp formatted using SimpleDateFormat.format.@param pattern – timestamp format pattern
@return formatted timestamp as String

Error Objects

Variables of type "error" internally are Objects of type emds.epi.decl.server.processengine.ErrorObject.

If you add an intermediate event of type error to an activity, then the intermediate event has an output parameter named ERROR of type error which you can then use in the process model. The error object provides these getter methods:

SignatureDescriptionParameters
String getErrorCode()Return the error code.@return error code as String
String getErrorMessage()Return the error message.@return error message as String
String toString()Return a formatted String representation of the error.@return "ErrorCode: [" + errorCode + "]\nErrorDetail: [" + errorMessage + "]"
ScenarioContext getScenarioContext()Return the scenario context associated with the error. Only available if set by the creator.@return ScenarioContext or null
Located in emds.epi.decl.server.event
Useful method: getFullDescription()
ErrorContext getErrorContext()Return the error context associated with the error. Only available if set by the creator.@return ErrorContext or null
Located in emds.epi.decl.server.event
Useful method: getFullDescription()
Message getMessage()Return the Orchestra message associated with the error. Only available if set by the creator.@return Message or null
ErrorObject createErrorInfo( String errorCode, String errorMessage )Create a new ErrorObject with the given error code and message.@param errorCode – error code to set
@param errorMessage – error message to set
@return ErrorObject (can be assigned to process variable ERROR)
ErrorObject passOrCreateDefaultError( ErrorObject errorObject )Return the given ErrorObject or create a default one if null.@param errorObject – may be null
@return existing error or default error

If a process model is created, a default local variable ERROR is also created:

Default Process Variables Default Process Variables

Intermediate Event Errors

If an intermediate error event is used, the ERROR object from the error event must be filled to the local variable from the process model: